package com.yc.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yc.entity.Comment;
import com.yc.mapper.CommentMapper;
import com.yc.service.ICommentService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.time.LocalDateTime;

/**
 * <p>
 * InnoDB free: 4096 kB 服务实现类
 * </p>
 *
 * @author ly
 * @since 2022-05-25
 */
@Service
public class CommentServiceImpl extends ServiceImpl<CommentMapper, Comment> implements ICommentService {
    @Resource
    private CommentMapper commentMapper;

    @Override
    public Integer discuss(Integer ctid, Integer uid, String massage) {
        Comment comment=new Comment();
        comment.setCtid(ctid);
        comment.setUid(uid);
        comment.setCmdetails(massage);
        comment.setCmdate(LocalDateTime.now());
        comment.setPraisenum(0);
        comment.setStampnum(0);
        return commentMapper.insert(comment);
    }
}
